package org.zfes.snowier.cloud.zbss.cms.router.service.column;

import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.cms.column.model.CmsColumnCount;
import org.zfes.snowier.cloud.zbss.cms.column.service.ICmsColumnCountService;
@Controller("org.zfes.snowier.cloud.zbss.cms.column.router.service.CmsColumnCountController")  
@RequestMapping("/cms/service/column/cmsColumnCount")
public class CmsColumnCountController extends BaseController {

	
	@Autowired
	private ICmsColumnCountService cmsColumnCountService;
	
	@RequiresPermissions(value="cmsColumnCount:loadCmsColumnCountDataSet",desc="栏目统计列表")
    @RequestMapping(value="/loadCmsColumnCountDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsColumnCountDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  cmsColumnCountService.loadCmsColumnCountDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
	@RequiresPermissions(value="cmsColumnCount:createCmsColumnCount",desc="栏目统计添加")
    @RequestMapping(value="/createCmsColumnCount", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createCmsColumnCount(CmsColumnCount cmsColumnCount){
		cmsColumnCountService.createCmsColumnCount(cmsColumnCount);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsColumnCount:loadCmsColumnCount",desc="栏目统计加载")
    @RequestMapping(value="/loadCmsColumnCount", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsColumnCount(Long id){
		Optional<CmsColumnCount> ops = cmsColumnCountService.loadCmsColumnCountById(id);
		return ajaxQuery("cmsColumnCount",ops);
    }
	
	@RequiresPermissions(value="cmsColumnCount:updateCmsColumnCount",desc="栏目统计更新")
    @RequestMapping(value="/updateCmsColumnCount", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateCmsColumnCount(CmsColumnCount cmsColumnCount){
		cmsColumnCountService.updateCmsColumnCount(cmsColumnCount);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsColumnCount:deletCmsColumnCount",desc="栏目统计删除")
    @RequestMapping(value="/deleteCmsColumnCount", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteCmsColumnCount(Long id){
		cmsColumnCountService.deleteCmsColumnCount(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }

}